﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="indexSet.aspx.cs" Inherits="Admin_indexSet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>首页设置</title>
        <style type="text/css">
        td 
        {
            background-color:#ffffff;
            
        }
    </style>

   
</head>
<body>
    <form id="form1" runat="server">
    <fieldset title="" style="width:700px">
        <legend>上传图片</legend>
        <table cellpadding="2" border="0" cellspacing="2">
            <tr>
                <td>图片：</td>
                <td><asp:FileUpload ID="upPic" runat="server" Width="464px" /></td>
                <td rowspan="2"><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="上 传" Height="46px" /></td>
            </tr>
            <tr>
                <td>页面完整路径：</td>
                <td><asp:TextBox ID="txtURL" runat="server" Width="457px"></asp:TextBox></td>
            </tr>
        </table> 
 
        </fieldset> 
        <div style="visibility:hidden">
            <asp:TextBox ID="txtID" runat="server"></asp:TextBox>
            <asp:Button ID="btnDelete" runat="server" Text="Button" OnClick="btnDelete_Click" />
        </div>
    <div>
            <table style="width:99%; background-color:#888888;">
                <tr>
                    <td style="width: 45px">NO.</td>
                    <td style="width: 226px" align="center">图片</td>
                    <td style="width: 392px" align="center">URL</td>
                    <td align="center">操作</td>
                </tr>
                <asp:Repeater ID="Repeater1" runat="server">
                
                    <ItemTemplate>
                        <tr>  
                            <td><%# Container.ItemIndex +1 %></td>
                            <td style="width: 355px"  >
                                <asp:Image ID="pic1" runat="server" Height="67px" ImageUrl='<%# Eval("picPath") %>'  />  
                            </td>                        
                            <td><a href='<%# Eval("picURL") %>'>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("picURL") %>'></asp:Label></a>
                           </td>     
                           <td>
                                <a href='javascript:void(0); ' type="button" onclick='Delete(<%# Eval("picID") %>)' >删除</a>
                           </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>

            </table>
    </div>
    </form>
    <script language="javascript" type="text/javascript">
        function Delete(id)
        {
            document.getElementById("txtID").value = id;
            document.getElementById("upPic").value = "";
            document.getElementById("btnDelete").click();
        }
    </script>
</body>

</html>
